package cn.alex.sso.project.mapper;

import cn.alex.sso.project.entity.SysDept;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @author Alex
 * @description 针对表【sys_dept(部门表)】的数据库操作Mapper
 * @createDate 2024-09-24 17:05:38
 * @Entity cn.alex.sso.project.entity.SysDept
 */
public interface SysDeptMapper extends BaseMapper<SysDept> {

    default LambdaQueryWrapper<SysDept> getQueryWrapper(SysDept sysDept) {
        return new LambdaQueryWrapper<SysDept>()
                .like(StrUtil.isNotBlank(sysDept.getName()), SysDept::getName, sysDept.getName())
                .orderByAsc(SysDept::getSorted);
    }
}




